INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
LINK_DIRECTORIES(${3RDPARTY_DIR}/lib/grpc)

SET(TARGET_H
    rada.pb.h
    rada.grpc.pb.h
    apiinterface.pb.h
    apiinterface.grpc.pb.h
)

SET(TARGET_SRC
    gRPC.cpp
    rada.pb.cc
    rada.grpc.pb.cc
    apiinterface.pb.cc
    apiinterface.grpc.pb.cc
)

SETUP_GROUP()

SET(TARGET_ADDED_LIBRARIES
)

SET(TARGET_EXTERNAL_LIBRARIES 
    zlib
    grpc++_reflection
    grpc++
    gpr
    libprotobuf
    grpc
    cares
    Advapi32
    address_sorting
    re2
    upb
    absl_raw_hash_set
    absl_hashtablez_sampler
    absl_hash
    absl_city
    absl_low_level_hash
    absl_statusor
    ws2_32
    crypt32
    absl_synchronization
    absl_bad_variant_access
    absl_status
    absl_strerror
    absl_random_distributions
    absl_random_seed_sequences
    absl_random_internal_pool_urbg
    absl_random_internal_randen
    absl_random_internal_randen_hwaes
    absl_random_internal_randen_hwaes_impl
    absl_random_internal_randen_slow
    absl_random_internal_platform
    absl_random_internal_seed_material
    absl_random_seed_gen_exception
    absl_cord
    absl_bad_optional_access
    absl_cordz_info
    absl_cord_internal
    absl_cordz_functions
    absl_exponential_biased
    absl_cordz_handle
    absl_str_format_internal
    absl_synchronization
    absl_stacktrace
    absl_symbolize
    absl_debugging_internal
    absl_demangle_internal
    absl_graphcycles_internal
    absl_malloc_internal
    absl_time
    absl_strings
    absl_throw_delegate
    absl_int128
    absl_strings_internal
    absl_base
    absl_spinlock_wait
    absl_raw_logging_internal
    absl_log_severity
    absl_civil_time
    absl_time_zone
    -ignore:4221
    ssl
    crypto
)
ADD_DEFINITIONS(-DCARES_STATICLIB)
SETUP_PLUGIN(gRPC)
SETUP_PLUGIN_DEP(gRPC OCMain)


if (MSVC)
  set_property(TARGET OCPP_gRPC PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreadedDLL")
endif()

